'''定义my_webs的URL模式'''
from django.conf.urls import url#使用它来将url映射到视图
from . import views #句号 让Python从当前的模块所在的文件夹导入视图
urlpatterns = [
    #主页
    url(r'^$', views.index, name='index'),
    #显示所有的主题
    url(r'^topics/$',views.topics, name='topics'),
    url(r'^topics/(?P<topic_id>\d+)/$', views.topic, name='topic'),
    url(r'^new_topic/$', views.new_topic, name='new_topic'),
    url(r'^new_entry/(?P<topic_id>\d+)/$', views.new_entry, name='new_entry'),
    url(r'^edit_entry/(?P<entry_id>\d+)/$', views.edit_entry, name='edit_entry')
]